package cn.itsource.ymcc.feign;

import cn.itsource.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class SystemFeignFallbackFactory implements FallbackFactory<SystemFeign> {
    @Override
    public SystemFeign create(Throwable throwable) {
        return new SystemFeign() {

            @Override
            public JSONResult list() {
                throwable.printStackTrace();
                return null;
            }

            @Override
            public JSONResult get(Long id) {
                throwable.printStackTrace();
                return null;
            }


        };
    }
}
